from base.base import Base
from selenium.webdriver.common.by import By
from time import sleep

class SousuoPage(Base):

    fangdajing=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout[2]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.ImageView')

    ershida=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[1]/android.widget.LinearLayout/android.view.ViewGroup/android.widget.FrameLayout[1]/android.widget.TextView')

    fanhui=(By.ID,'cn.xuexi.android:id/search_back')

    dy1=(By.XPATH,'//android.widget.TextView[@text="推荐"]')

    dy2=(By.XPATH,'//android.widget.TextView[@text="发现"]')

    def sousuoyewu(self):
        self.loc_ele(self.fangdajing).click()
        sleep(2)

        self.loc_ele(self.ershida).click()
        sleep(2)

        self.loc_ele(self.fanhui).click()
        sleep(2)

        self.loc_ele(self.fanhui).click()
        sleep(2)